package com.scy.java.loop;

import java.util.Scanner;

//return语句
public class ReturnExample {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入操作数1：");
        double num1 = scanner.nextDouble();
        System.out.println("请输入操作数2：");
        double num2 = scanner.nextDouble();
        double d = sumNumber(num1, num2);
        System.out.println(num1+"+"+num2+"="+d);

    }
//    创建求和方法返回值为double
    public static double sumNumber(double n1,double n2){
        double sum = n1+n2;
        return sum;
    }
}
